package common.design.observer;

/**
 * Created by dong peng on 2018/1/28.
 *
 * 订阅者
 */
public class ObserverAImpl implements Observer{

    public void onMessageEvent(Topic topic) {
        if(topic instanceof TopicAImpl) {
            TopicAImpl topicA = (TopicAImpl) topic;
            System.out.println("观察者"+Observer.class.getName()+"收到通知:" + topicA.getData());
        }
    }
}
